package com.jdk8.demo.stream;

import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.stream.Stream;

/**
 * 文件流
 *
 */
public class FileStream {
    public static void main(String[] args) {
        try (Stream<String> lines = Files.lines(Paths.get("D:\\韦伯英语.txt"), Charset.forName("UTF-8"))) {

            lines.forEach(System.out::println);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}